home *** CD-ROM | disk | FTP | other *** search
- { Cursor.doc - documentation for QWIK cursor routines ver 4.1, 05-01-88 }
-
- GotoRC - Like Turbo's GotoXY, this procedure moves the cursor, but with a
- couple of important differences. The cursor is absolute to the entire
- screen and ignores the limits set by the Turbo Window procedure. In
- addition, it will work on all the other video pages besides page 0.
-
- CursorChange - This procedure will let you change the mode (shape and
- visibility) of the cursor. At the same time, it saves the previous mode.
- Using hex is the easiest way to set the integer. The shape of the cursor
- is defined by horizontal scan lines in the character cell where the top row
- is of any cell is 0. The starting (upper) row of the cursor mode is the
- high (or left) byte of the integer and the ending (lower) row is the low
- (or right) byte. In addition, bits 5 and 6 of the starting row byte
- control on/off and erratic blinking (remember a byte has bits 0 to 7). See
- QINIT.DOC for cell sizes.
-
- Shape: Adapter Default Comments
- -------- ------- -------------------------
- MDA $0B0C
- CGA,MCGA $0607
- EGA $0B0C MD, ECD (640x350 25-line)
- EGA $0607 CD, ECD (640x200)
- VGA $0D0E Emulation off
- 3270 PC $0D0D And converts MDA and CGA
-
- Cursor off: Set start row bits 6-5 = 01. All other bits don't matter.
- Blinking: Set start row bits 6-5 = 11. Creates erratic blinking on
- most machines.
- | Skew: Set end bits 6-5 = 01, 10, or 11 on EGA or VGA to skew the
- | cursor to the right by 1, 2, or 3 spaces respectively.
-
- Suggestions: For block cursor, set New:=$000E (Works on all machines.)
- For hidden cursor, set New:=$2000
-
- CursorOff - Rather than using CursorChange to hide the cursor, use this
- procedure. You don't have to save the current cursor shape since all it
- does is set the cursor-off bit on the current cursor mode.
-
- CursorOn - To restore the cursor after turning it off with CursorOff, use
- this procedure. The previous shape is maintained.
-
- WhereR/WhereC - Also like Turbo's WhereX/WhereY, these functions detect
- cursor position, but with the same differences as GotoRC.
-
- Suggestions - Use discretion when changing the cursor mode. Some users
- prefer a block cursor for all their applications. If your program forces
- it to an underline, try to restore the original cursor. Programs like
- WordStar, never even touch the cursor. There is only one case that I know
- where you must set the cursor mode before using CursorOff/On. The early
- PCs had a bug in the BIOS that set the MDA default to be CGA instead. You
- can check for ActiveDispDev=MdaMono and a $0607 cursor. If so, change it
- to $0B0C for an underline.
-
- EGA Cursor Emulation - With 640x200, the emulation works fairly well. With
- 640x350 and 25-line mode, the emulation works, too. Outside of that, it is
- suggested that any needed changes should be made with emulation off which
- can be done be setting bit 0 of EgaInfo equal to 1.
-
- MCGA Cursor Emulation - Use the CGA cursor cell size even though the
- character cell is 8x16. The BIOS multiplies the start and end rows by 2
- and then adds one to the end row before writing to the hardware video port
- to emulate the CGA.
-
- VGA Cursor Emulation - Qinit sets the cursor emulation mode on so you don't
- have to worry about special fonts and cells sizes. The only cell sizes you
- need to know is the MDA and CGA. The video BIOS will adjust your cursor
- shape to fit in the current cell size. Here's the cursor shapes (types)
- recognized by the VGA algorithm and how it responds:
-
- Cursor Type Condition Action
- ------------ ------------------- ---------------
- Hidden (off) start bits 6-5 = 01 pass
- Split start > end invert to block
- Overbar start < end <= 3 pass
- Underline start+2 >= end adjust
- Full-block start <= 2 adjust
- Half-block start > 2 adjust
-
-
- For adjustment, three more tests are required:
-
- Condition Action
- -------------------------------- ----------
- start or end >= cell height adjust
- end = cell height - 1 pass
- start = cell height - 2 pass
-
-
- The final adjustment is made to the corresponding cursor type:
-
- Cursor Type Adjustment
- ----------- -------------------------------------------------
- Overbar pass
- Underline move start/end to bottom of cell
- Half-block start = cell height/2; move end to bottom of cell
- Full-block move end to bottom of cell
-
-
- 3270 PC Peculiarites - The 3270 PC cursor types are limited to only three.
- In addition, the underline cursor is not visible on a white background on
- the 5272 color display and it is advisable to use a block cursor together
- with that attribute:
-
- Cursor Type Comments
- ------------ ---------------------------------------------------
- Underline $0D0D only. CGA and MDA are emulated to this type.
- Hidden (off) cursor start > cursor end. $2000 is preferred.
- Block anything other than the above